package com.tourism.product.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tourism.product.mapper.ProductImageMapper;
import com.tourism.product.domain.ProductImage;
import com.tourism.product.service.IProductImageService;

/**
 * 产品图片Service业务层处理
 * 
 * @author silenceEcho
 * @date 2025-04-13
 */
@Service
public class ProductImageServiceImpl implements IProductImageService 
{
    @Autowired
    private ProductImageMapper productImageMapper;

    /**
     * 查询产品图片
     * 
     * @param imageId 产品图片主键
     * @return 产品图片
     */
    @Override
    public ProductImage selectProductImageByImageId(Long imageId)
    {
        return productImageMapper.selectProductImageByImageId(imageId);
    }

    /**
     * 查询产品图片列表
     * 
     * @param productImage 产品图片
     * @return 产品图片
     */
    @Override
    public List<ProductImage> selectProductImageList(ProductImage productImage)
    {
        return productImageMapper.selectProductImageList(productImage);
    }

    /**
     * 新增产品图片
     * 
     * @param productImage 产品图片
     * @return 结果
     */
    @Override
    public int insertProductImage(ProductImage productImage)
    {
        productImage.setCreateTime(DateUtils.getNowDate());
        return productImageMapper.insertProductImage(productImage);
    }

    /**
     * 修改产品图片
     * 
     * @param productImage 产品图片
     * @return 结果
     */
    @Override
    public int updateProductImage(ProductImage productImage)
    {
        productImage.setUpdateTime(DateUtils.getNowDate());
        return productImageMapper.updateProductImage(productImage);
    }

    /**
     * 批量删除产品图片
     * 
     * @param imageIds 需要删除的产品图片主键
     * @return 结果
     */
    @Override
    public int deleteProductImageByImageIds(Long[] imageIds)
    {
        return productImageMapper.deleteProductImageByImageIds(imageIds);
    }

    /**
     * 删除产品图片信息
     * 
     * @param imageId 产品图片主键
     * @return 结果
     */
    @Override
    public int deleteProductImageByImageId(Long imageId)
    {
        return productImageMapper.deleteProductImageByImageId(imageId);
    }
}
